package synchronicity.ui;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;

import synchronicity.util.MeetingScheduler.MeetingResult;
import ui.DisplayContext;
import ui.Screen;

public class ScheduleResultScreen extends Screen {
	MeetingResult result;
	
	private Form list;

	public ScheduleResultScreen(MeetingResult result, DisplayContext context) {
		super(context);
		this.result = result;
		list = new Form("Results");
		list.append(result.successfulHosts.size() +" hosts accepted \n");
		list.append(result.failedHosts.size() + " hosts rejected \n");
		list.append(result.offlineHosts.size() + " hosts went offline ");
	}

	protected Command[] getCommands() {
		return new Command[] { new Command("Ok", Command.OK, 0) };
	}

	protected Displayable getDisplayable() {
		return list;
	}

	protected String getTitle() {
		return "Synchronicity";
	}

	public void commandAction(Command arg0, Displayable arg1) {
		System.out.println("ScheduleResultScreen"+arg0);
		switchScreen(HomeScreen.getInstance(getContext()));
	}
}
